//
//  ZGEditViewController.m
//  扫码
//
//  Created by 鲍志刚 on 16/4/5.
//  Copyright © 2016年 鲍志刚. All rights reserved.
//

#import "NetworkTools.h"

@implementation NetworkTools
+ (instancetype)sharedTools {
    static NetworkTools *tools;
    
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        
        //
        NSURL *baseURL = [NSURL URLWithString:@"http://192.168.0.123:8080/APP2/"];
        
        NSURLSessionConfiguration *config = [NSURLSessionConfiguration defaultSessionConfiguration];
        //设置请求的超时时长
        config.timeoutIntervalForRequest = 15;
        tools = [[self alloc] initWithBaseURL:baseURL sessionConfiguration:config];
        
        
        //acceptableContentTypes = [NSSet setWithObjects:@"application/json", @"text/json", @"text/javascript", nil];
        tools.responseSerializer.acceptableContentTypes = [NSSet setWithObjects:@"application/json", @"text/json", @"text/javascript",@"text/html", nil];
    });
    
    
    return tools;
}
@end
